#include <cassert>
#include "../source/data.hh"

void print_info(const cloud::backup_info& info)
{
    std::cout << info.mtime << std::endl;
    std::cout << info.fsize << std::endl;
    std::cout << info.fpath << std::endl;
    std::cout << info.bpath << std::endl;
}

void test_data()
{
    cloud::backup_info info("test.txt");
    print_info(info);

    assert(cloud::data_manager::instance().insert(info));

    cloud::backup_info* pinfo = 
        cloud::data_manager::instance().get_by_bpath(info.bpath);
    assert(pinfo);

    print_info(*pinfo);
}

int main()
{
    test_data();

    return 0;
}
